#!/usr/bin/python
"""Starts Pyro3 Event Server.

Based on http://code.google.com/p/raspberry-ui/source/browse/trunk/eventserver.py

"""
if __name__ == "__main__":
	from misc import misc
	import Pyro.naming
	import Pyro.EventService.Server

	hostname = misc.AskUser()
	#nsport = 9089

	starter = Pyro.EventService.Server.EventServiceStarter()
	# we're using the OS's automatic port allocation
	es_port=0 
	starter.start(hostname=hostname, port=es_port, norange=(es_port==0))
	starter.waitUntilStarted()
		    
